<template>
  <div>
     <van-nav-bar
   title="列表"
  left-arrow
  @click-left="$router.back()"
/>
      <van-card 
      v-for="item in goodlists " :key="item.id"
     :price="item.price|toPrice"
     :desc="item.description"
     :title="item.goodsname"
     :thumb="$imgUrl+item.img"
     @click="$router.push('/detail/'+item.id)"
/>
  </div>
</template>

<script>
import {getGoodsinfo} from "./util/axios"
export default {
    data(){
        return{
         goodlists:[]
        }
    },
  mounted(){
        getGoodsinfo({ fid: this.$route.params.id }).then((res) => {
        if (res.code == 200) {
           let list = res.list?res.list:[];
           this.goodlists = list;
        }
      });
  }
}
</script>

<style>

</style>